# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DFAReporting.V33.Model.Ad do
  @moduledoc """
  Contains properties of a Campaign Manager ad.

  ## Attributes

  *   `defaultClickThroughEventTagProperties` (*type:* `GoogleApi.DFAReporting.V33.Model.DefaultClickThroughEventTagProperties.t`, *default:* `nil`) - Default click-through event tag properties for this ad.
  *   `advertiserId` (*type:* `String.t`, *default:* `nil`) - Advertiser ID of this ad. This is a required field on insertion.
  *   `size` (*type:* `GoogleApi.DFAReporting.V33.Model.Size.t`, *default:* `nil`) - Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD.
  *   `subaccountId` (*type:* `String.t`, *default:* `nil`) - Subaccount ID of this ad. This is a read-only field that can be left blank.
  *   `lastModifiedInfo` (*type:* `GoogleApi.DFAReporting.V33.Model.LastModifiedInfo.t`, *default:* `nil`) - Information about the most recent modification of this ad. This is a read-only field.
  *   `accountId` (*type:* `String.t`, *default:* `nil`) - Account ID of this ad. This is a read-only field that can be left blank.
  *   `languageTargeting` (*type:* `GoogleApi.DFAReporting.V33.Model.LanguageTargeting.t`, *default:* `nil`) - Language targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD.
  *   `startTime` (*type:* `DateTime.t`, *default:* `nil`) - 
  *   `advertiserIdDimensionValue` (*type:* `GoogleApi.DFAReporting.V33.Model.DimensionValue.t`, *default:* `nil`) - Dimension value for the ID of the advertiser. This is a read-only, auto-generated field.
  *   `deliverySchedule` (*type:* `GoogleApi.DFAReporting.V33.Model.DeliverySchedule.t`, *default:* `nil`) - Delivery schedule information for this ad. Applicable when type is AD_SERVING_STANDARD_AD or AD_SERVING_TRACKING. This field along with subfields priority and impressionRatio are required on insertion when type is AD_SERVING_STANDARD_AD.
  *   `audienceSegmentId` (*type:* `String.t`, *default:* `nil`) - Audience segment ID that is being targeted for this ad. Applicable when type is AD_SERVING_STANDARD_AD.
  *   `creativeRotation` (*type:* `GoogleApi.DFAReporting.V33.Model.CreativeRotation.t`, *default:* `nil`) - Creative rotation for this ad. Applicable when type is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or AD_SERVING_TRACKING. When type is AD_SERVING_DEFAULT_AD, this field should have exactly one creativeAssignment .
  *   `createInfo` (*type:* `GoogleApi.DFAReporting.V33.Model.LastModifiedInfo.t`, *default:* `nil`) - Information about the creation of this ad. This is a read-only field.
  *   `kind` (*type:* `String.t`, *default:* `nil`) - Identifies what kind of resource this is. Value: the fixed string "dfareporting#ad".
  *   `eventTagOverrides` (*type:* `list(GoogleApi.DFAReporting.V33.Model.EventTagOverride.t)`, *default:* `nil`) - Event tag overrides for this ad.
  *   `keyValueTargetingExpression` (*type:* `GoogleApi.DFAReporting.V33.Model.KeyValueTargetingExpression.t`, *default:* `nil`) - Key-value targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD.
  *   `campaignId` (*type:* `String.t`, *default:* `nil`) - Campaign ID of this ad. This is a required field on insertion.
  *   `geoTargeting` (*type:* `GoogleApi.DFAReporting.V33.Model.GeoTargeting.t`, *default:* `nil`) - Geographical targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Name of this ad. This is a required field and must be less than 256 characters long.
  *   `campaignIdDimensionValue` (*type:* `GoogleApi.DFAReporting.V33.Model.DimensionValue.t`, *default:* `nil`) - Dimension value for the ID of the campaign. This is a read-only, auto-generated field.
  *   `dayPartTargeting` (*type:* `GoogleApi.DFAReporting.V33.Model.DayPartTargeting.t`, *default:* `nil`) - Time and day targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD.
  *   `comments` (*type:* `String.t`, *default:* `nil`) - Comments for this ad.
  *   `clickThroughUrlSuffixProperties` (*type:* `GoogleApi.DFAReporting.V33.Model.ClickThroughUrlSuffixProperties.t`, *default:* `nil`) - Click-through URL suffix properties for this ad. Applies to the URL in the ad or (if overriding ad properties) the URL in the creative.
  *   `archived` (*type:* `boolean()`, *default:* `nil`) - Whether this ad is archived. When true, active must be false.
  *   `idDimensionValue` (*type:* `GoogleApi.DFAReporting.V33.Model.DimensionValue.t`, *default:* `nil`) - Dimension value for the ID of this ad. This is a read-only, auto-generated field.
  *   `endTime` (*type:* `DateTime.t`, *default:* `nil`) - 
  *   `type` (*type:* `String.t`, *default:* `nil`) - Type of ad. This is a required field on insertion. Note that default ads ( AD_SERVING_DEFAULT_AD) cannot be created directly (see Creative resource).
  *   `dynamicClickTracker` (*type:* `boolean()`, *default:* `nil`) - Whether this ad is a dynamic click tracker. Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required field on insert, and is read-only after insert.
  *   `active` (*type:* `boolean()`, *default:* `nil`) - Whether this ad is active. When true, archived must be false.
  *   `compatibility` (*type:* `String.t`, *default:* `nil`) - Compatibility of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to either rendering on desktop or on mobile devices or in mobile apps for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are only used for existing default ads. New mobile placements must be assigned DISPLAY or DISPLAY_INTERSTITIAL and default ads created for those placements will be limited to those compatibility types. IN_STREAM_VIDEO refers to rendering in-stream video ads developed with the VAST standard.
  *   `id` (*type:* `String.t`, *default:* `nil`) - ID of this ad. This is a read-only, auto-generated field.
  *   `technologyTargeting` (*type:* `GoogleApi.DFAReporting.V33.Model.TechnologyTargeting.t`, *default:* `nil`) - Technology platform targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD.
  *   `creativeGroupAssignments` (*type:* `list(GoogleApi.DFAReporting.V33.Model.CreativeGroupAssignment.t)`, *default:* `nil`) - Creative group assignments for this ad. Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment per creative group number is allowed for a maximum of two assignments.
  *   `sslRequired` (*type:* `boolean()`, *default:* `nil`) - Whether this ad requires ssl. This is a read-only field that is auto-generated when the ad is inserted or updated.
  *   `sslCompliant` (*type:* `boolean()`, *default:* `nil`) - Whether this ad is ssl compliant. This is a read-only field that is auto-generated when the ad is inserted or updated.
  *   `remarketingListExpression` (*type:* `GoogleApi.DFAReporting.V33.Model.ListTargetingExpression.t`, *default:* `nil`) - Remarketing list targeting expression for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is AD_SERVING_STANDARD_AD.
  *   `targetingTemplateId` (*type:* `String.t`, *default:* `nil`) - Targeting template ID, used to apply preconfigured targeting information to this ad. This cannot be set while any of dayPartTargeting, geoTargeting, keyValueTargetingExpression, languageTargeting, remarketingListExpression, or technologyTargeting are set. Applicable when type is AD_SERVING_STANDARD_AD.
  *   `clickThroughUrl` (*type:* `GoogleApi.DFAReporting.V33.Model.ClickThroughUrl.t`, *default:* `nil`) - Click-through URL for this ad. This is a required field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER.
  *   `placementAssignments` (*type:* `list(GoogleApi.DFAReporting.V33.Model.PlacementAssignment.t)`, *default:* `nil`) - Placement assignments for this ad.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :defaultClickThroughEventTagProperties =>
            GoogleApi.DFAReporting.V33.Model.DefaultClickThroughEventTagProperties.t() | nil,
          :advertiserId => String.t() | nil,
          :size => GoogleApi.DFAReporting.V33.Model.Size.t() | nil,
          :subaccountId => String.t() | nil,
          :lastModifiedInfo => GoogleApi.DFAReporting.V33.Model.LastModifiedInfo.t() | nil,
          :accountId => String.t() | nil,
          :languageTargeting => GoogleApi.DFAReporting.V33.Model.LanguageTargeting.t() | nil,
          :startTime => DateTime.t() | nil,
          :advertiserIdDimensionValue =>
            GoogleApi.DFAReporting.V33.Model.DimensionValue.t() | nil,
          :deliverySchedule => GoogleApi.DFAReporting.V33.Model.DeliverySchedule.t() | nil,
          :audienceSegmentId => String.t() | nil,
          :creativeRotation => GoogleApi.DFAReporting.V33.Model.CreativeRotation.t() | nil,
          :createInfo => GoogleApi.DFAReporting.V33.Model.LastModifiedInfo.t() | nil,
          :kind => String.t() | nil,
          :eventTagOverrides => list(GoogleApi.DFAReporting.V33.Model.EventTagOverride.t()) | nil,
          :keyValueTargetingExpression =>
            GoogleApi.DFAReporting.V33.Model.KeyValueTargetingExpression.t() | nil,
          :campaignId => String.t() | nil,
          :geoTargeting => GoogleApi.DFAReporting.V33.Model.GeoTargeting.t() | nil,
          :name => String.t() | nil,
          :campaignIdDimensionValue => GoogleApi.DFAReporting.V33.Model.DimensionValue.t() | nil,
          :dayPartTargeting => GoogleApi.DFAReporting.V33.Model.DayPartTargeting.t() | nil,
          :comments => String.t() | nil,
          :clickThroughUrlSuffixProperties =>
            GoogleApi.DFAReporting.V33.Model.ClickThroughUrlSuffixProperties.t() | nil,
          :archived => boolean() | nil,
          :idDimensionValue => GoogleApi.DFAReporting.V33.Model.DimensionValue.t() | nil,
          :endTime => DateTime.t() | nil,
          :type => String.t() | nil,
          :dynamicClickTracker => boolean() | nil,
          :active => boolean() | nil,
          :compatibility => String.t() | nil,
          :id => String.t() | nil,
          :technologyTargeting => GoogleApi.DFAReporting.V33.Model.TechnologyTargeting.t() | nil,
          :creativeGroupAssignments =>
            list(GoogleApi.DFAReporting.V33.Model.CreativeGroupAssignment.t()) | nil,
          :sslRequired => boolean() | nil,
          :sslCompliant => boolean() | nil,
          :remarketingListExpression =>
            GoogleApi.DFAReporting.V33.Model.ListTargetingExpression.t() | nil,
          :targetingTemplateId => String.t() | nil,
          :clickThroughUrl => GoogleApi.DFAReporting.V33.Model.ClickThroughUrl.t() | nil,
          :placementAssignments =>
            list(GoogleApi.DFAReporting.V33.Model.PlacementAssignment.t()) | nil
        }

  field(:defaultClickThroughEventTagProperties,
    as: GoogleApi.DFAReporting.V33.Model.DefaultClickThroughEventTagProperties
  )

  field(:advertiserId)
  field(:size, as: GoogleApi.DFAReporting.V33.Model.Size)
  field(:subaccountId)
  field(:lastModifiedInfo, as: GoogleApi.DFAReporting.V33.Model.LastModifiedInfo)
  field(:accountId)
  field(:languageTargeting, as: GoogleApi.DFAReporting.V33.Model.LanguageTargeting)
  field(:startTime, as: DateTime)
  field(:advertiserIdDimensionValue, as: GoogleApi.DFAReporting.V33.Model.DimensionValue)
  field(:deliverySchedule, as: GoogleApi.DFAReporting.V33.Model.DeliverySchedule)
  field(:audienceSegmentId)
  field(:creativeRotation, as: GoogleApi.DFAReporting.V33.Model.CreativeRotation)
  field(:createInfo, as: GoogleApi.DFAReporting.V33.Model.LastModifiedInfo)
  field(:kind)
  field(:eventTagOverrides, as: GoogleApi.DFAReporting.V33.Model.EventTagOverride, type: :list)

  field(:keyValueTargetingExpression,
    as: GoogleApi.DFAReporting.V33.Model.KeyValueTargetingExpression
  )

  field(:campaignId)
  field(:geoTargeting, as: GoogleApi.DFAReporting.V33.Model.GeoTargeting)
  field(:name)
  field(:campaignIdDimensionValue, as: GoogleApi.DFAReporting.V33.Model.DimensionValue)
  field(:dayPartTargeting, as: GoogleApi.DFAReporting.V33.Model.DayPartTargeting)
  field(:comments)

  field(:clickThroughUrlSuffixProperties,
    as: GoogleApi.DFAReporting.V33.Model.ClickThroughUrlSuffixProperties
  )

  field(:archived)
  field(:idDimensionValue, as: GoogleApi.DFAReporting.V33.Model.DimensionValue)
  field(:endTime, as: DateTime)
  field(:type)
  field(:dynamicClickTracker)
  field(:active)
  field(:compatibility)
  field(:id)
  field(:technologyTargeting, as: GoogleApi.DFAReporting.V33.Model.TechnologyTargeting)

  field(:creativeGroupAssignments,
    as: GoogleApi.DFAReporting.V33.Model.CreativeGroupAssignment,
    type: :list
  )

  field(:sslRequired)
  field(:sslCompliant)
  field(:remarketingListExpression, as: GoogleApi.DFAReporting.V33.Model.ListTargetingExpression)
  field(:targetingTemplateId)
  field(:clickThroughUrl, as: GoogleApi.DFAReporting.V33.Model.ClickThroughUrl)

  field(:placementAssignments,
    as: GoogleApi.DFAReporting.V33.Model.PlacementAssignment,
    type: :list
  )
end

defimpl Poison.Decoder, for: GoogleApi.DFAReporting.V33.Model.Ad do
  def decode(value, options) do
    GoogleApi.DFAReporting.V33.Model.Ad.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DFAReporting.V33.Model.Ad do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
